home *** CD-ROM | disk | FTP | other *** search
- public abstract class Lib {
- public static final int MAX_VALUE = Integer.MAX_VALUE;
- public static final int MIN_VALUE = -2147483647;
- // $FF: renamed from: E int
- public static final int field_0 = 11134;
- // $FF: renamed from: PI int
- public static final int field_1 = 12868;
- // $FF: renamed from: a int[]
- private static final int[] field_2 = new int[]{0, 71, 142, 214, 285, 357, 428, 499, 570, 641, 711, 781, 851, 921, 990, 1060, 1128, 1197, 1265, 1333, 1400, 1468, 1534, 1600, 1665, 1730, 1795, 1859, 1922, 1985, 2048, 2109, 2170, 2230, 2290, 2349, 2407, 2464, 2521, 2577, 2632, 2686, 2740, 2793, 2845, 2896, 2946, 2995, 3043, 3091, 3137, 3183, 3227, 3271, 3313, 3355, 3395, 3434, 3473, 3510, 3547, 3582, 3616, 3649, 3681, 3712, 3741, 3770, 3797, 3823, 3849, 3872, 3895, 3917, 3937, 3956, 3974, 3991, 4006, 4020, 4033, 4045, 4056, 4065, 4073, 4080, 4086, 4090, 4093, 4095, 4096};
- public static final int ZERO = fixedPoint(0);
- public static final int ONE = fixedPoint(1);
- public static final int MINUS_ONE = fixedPoint(-1);
-
- private Lib() {
- }
-
- public static int fixedPoint(int var0) {
- return var0 << 12;
- }
-
- public static int fixedPoint(String var0) {
- byte var1 = 0;
- if (var0.charAt(0) == '-') {
- var1 = 1;
- }
-
- String var2 = "-1";
- int var3 = var0.indexOf(46);
- if (var3 >= 0) {
- for(var2 = var0.substring(var3 + 1, var0.length()); var2.length() < 4; var2 = var2 + "0") {
- }
-
- if (var2.length() > 4) {
- var2 = var2.substring(0, 4);
- }
- } else {
- var3 = var0.length();
- }
-
- int var4 = Integer.parseInt(var0.substring(var1, var3));
- int var5 = Integer.parseInt(var2) + 1;
- int var6 = (var4 << 12) + (var5 << 12) / 10000;
- if (var1 == 1) {
- var6 = -var6;
- }
-
- return var6;
- }
-
- public static int intValue(int var0) {
- if (var0 >= 0) {
- var0 += 2048;
- } else {
- var0 -= 2048;
- }
-
- return var0 >> 12;
- }
-
- public static int div(int var0, int var1) {
- boolean var2 = false;
- if (var1 == 4096) {
- return var0;
- } else if ((var1 & 4095) == 0) {
- return var0 / (var1 >> 12);
- } else {
- if (var0 < 0) {
- var0 = -var0;
- var2 = true;
- }
-
- if (var1 < 0) {
- var1 = -var1;
- if (var2) {
- var2 = false;
- } else {
- var2 = true;
- }
- }
-
- byte var3 = 0;
- if (var0 > 413695) {
- var3 = 3;
- }
-
- if (var0 > 4100095) {
- var3 = 4;
- }
-
- if (var0 > 8257535) {
- var3 = 6;
- }
-
- if (var0 > 32833535) {
- var3 = 8;
- }
-
- if (var0 > 132120575) {
- var3 = 10;
- }
-
- if (var3 > 0) {
- int var4 = 2 << var3 - 1;
- var0 += var4;
- var1 += var4;
- }
-
- int var5 = (var0 << 12 - var3) / (var1 >> var3);
- return var2 ? -var5 : var5;
- }
- }
-
- public static int mul(int var0, int var1) {
- boolean var2 = false;
- if ((var0 & 4095) == 0) {
- return (var0 >> 12) * var1;
- } else if ((var1 & 4095) == 0) {
- return var0 * (var1 >> 12);
- } else {
- if (var0 < 0 && var1 > 0 || var0 > 0 && var1 < 0) {
- var2 = true;
- }
-
- if (var0 < 0) {
- var0 = -var0;
- }
-
- if (var1 < 0) {
- var1 = -var1;
- }
-
- byte var3 = 0;
- if (var0 > 413695 || var1 > 413695) {
- var3 = 2;
- }
-
- if (var0 > 4100095 || var1 > 4100095) {
- var3 = 4;
- }
-
- if (var0 > 41025535 || var1 > 41025535) {
- var3 = 6;
- }
-
- if (var3 > 0) {
- int var4 = 2 << var3 - 1;
- var0 += var4;
- var1 += var4;
- }
-
- int var6 = (var0 >> 12) * (var1 >> 12) << 12;
- int var5 = (var0 & 4095) * (var1 & 4095) >> 12;
- var5 += ((var0 & -4096) >> var3) * ((var1 & 4095) >> var3) >> 12 - (var3 << 1);
- var6 = var6 + var5 + (((var0 & 4095) >> var3) * ((var1 & -4096) >> var3) >> 12 - (var3 << 1));
- if (var6 < 0) {
- throw new ArithmeticException("Overflow");
- } else {
- return var2 ? -var6 : var6;
- }
- }
- }
-
- public static int add(int var0, int var1) {
- return var0 + var1;
- }
-
- public static int sub(int var0, int var1) {
- return var0 - var1;
- }
-
- public static int abs(int var0) {
- return var0 < 0 ? -var0 : var0;
- }
-
- public static int sin(int var0) {
- int var1;
- for(var1 = 0; var0 < 0; var0 += 25736) {
- }
-
- if (var0 > 25736) {
- var0 %= 25736;
- }
-
- int var2 = var0 * 10 / 714;
- if (var0 != 0 && var0 != 6434 && var0 != 12868 && var0 != 19302 && var0 != 25736) {
- var1 = var0 * 100 / 714 - var2 * 10;
- }
-
- if (var2 <= 90) {
- return method_0(var2, var1);
- } else if (var2 <= 180) {
- return method_0(180 - var2, var1);
- } else {
- return var2 <= 270 ? -method_0(var2 - 180, var1) : -method_0(360 - var2, var1);
- }
- }
-
- // $FF: renamed from: a (int, int) int
- private static int method_0(int var0, int var1) {
- return var1 > 0 && var1 < 10 && var0 < 90 ? field_2[var0] + (field_2[var0 + 1] - field_2[var0]) / 10 * var1 : field_2[var0];
- }
-
- public static int cos(int var0) {
- return sin(var0 + 6435);
- }
- }
-